<template>
	<view class="submit-order-wrapper">
		<view class="container" :style="{height:isMap?'100vh':''}">
			<view class="submit-order" v-if="!isMap">
				<view class="bg"></view>

				<!-- 收货地址 -->
				<view class="distribution-mode" v-if="selectDistributionWay">
					<view class="item-box">
						<view :class="[isDistribution ? 'active' : '' , 'item']" @tap='changeDistribution(0)'>
							{{i18n.mailToHome}}
						</view>
						<view :class="[isDistribution ? '' : 'active' , 'item']" @tap='changeDistribution(1)'>
							{{i18n.pickStore}}
						</view>
					</view>
				</view>
				<!-- 邮寄到家 -->
				<view class="address-box" v-if="isDistribution">
					<view v-if="!userAddr || isEditAddr">
						<view class="tit">
							<view class="text" v-if="!addressList.length">{{i18n.fillReceivingInformation}}</view>
							<view class="text" v-if="addressList.length">{{i18n.historicalAddress}}</view>
							<view class="total" v-if="addressList.length" @tap='AddressListPop'>
								{{i18n.inTotal}}{{addressList.length}}{{i18n.itemGe}}
							</view>
						</view>
						<view class="add-box">
							<view class="add-item">
								<view class="text">{{i18n.consignee}}</view>
								<input type="text" class="input" :value="receiver" maxlength="15"
									@input="onReceiverInput" :placeholder="i18n.consigneeTips" @click="hideTabbar"
									@focus="hideTabbar" @blur="showTabbar" />
							</view>
							<view class="add-item">
								<view class="text">{{i18n.mobilePhone}}</view>
								<input type="text" class="input" :value="mobile" :placeholder="i18n.enterContactNumber"
									maxlength="11" @input="onMobileInput" @click="hideTabbar" @focus="hideTabbar"
									@blur="showTabbar" />
							</view>
							<view class="add-item" @tap="translate">
								<view class="text">{{i18n.yourRegion}}</view>
								<view class="area" @input="onMobileInput" @click="hideTabbar" @focus="hideTabbar"
									@blur="showTabbar">
									<view class="" v-if="province">{{province + ' ' + city + ' ' + area}}</view>
									<view class="placeholder-text" v-if="!province || !saveEditFlag">
										{{i18n.selectProvinceCity}}
									</view>
									<view class="animation-element-wrapper" :animation="animation"
										:style="'visibility:' + (show ? 'visible':'hidden')"
										@tap.stop="hiddenFloatViewScreenClick">
										<view class="animation-element" @tap.stop="nono">
											<text class="right-bt" @tap.stop="hiddenFloatView">{{i18n.confirm}}</text>
											<view class="line"></view>
											<picker-view indicator-style="height: 50rpx;" :value="value"
												@change="bindChange" @tap.stop="nono">
												<!--省-->
												<picker-view-column>
													<view v-for="(item, index) in provArray" :key="index">
														{{item.areaName}}
													</view>
												</picker-view-column>
												<!--地级市-->
												<picker-view-column>
													<view v-for="(item, index) in cityArray" :key="index">
														{{item.areaName}}
													</view>
												</picker-view-column>
												<!--区县-->
												<picker-view-column>
													<view v-for="(item, index) in areaArray" :key="index">
														{{item.areaName}}
													</view>
												</picker-view-column>
											</picker-view>
										</view>
									</view>
								</view>
							</view>
							<view class="add-item">
								<view class="text">{{i18n.detailedAddress}}</view>
								<input type="text" maxlength="50" class="input" :value="addr" @input="onAddrInput"
									:placeholder="i18n.enteDetailedAddress" @click="hideTabbar" @focus="hideTabbar"
									@blur="showTabbar" />
								<image class="addres-icon" src="/static/images/icon/submit-address.png" @tap="selMap">
								</image>
							</view>
							<view class="add-item">
								<view class="btn" @tap="onSaveAddr">{{i18n.saveAndUse}}</view>
							</view>
						</view>
					</view>
					<view class="current-address" v-if="userAddr && !isEditAddr">
						<view class="c-address">{{userAddr.province}}{{userAddr.city}}{{userAddr.area}}{{userAddr.addr}}
						</view>
						<view class="c-user">{{userAddr.receiver}} {{userAddr.mobile}}</view>
						<view class="c-edit" @tap="toAddrListPage">
							<image src="/static/images/icon/revise.png"></image>
						</view>
					</view>
					<view class="choose-way" @tap='distributionPop' v-if="selectDistributionWay">
						<view class="text">{{i18n.deliveryMethod}}</view>
						<view class="go">
							{{dvyType==1?i18n.expressDelivery:dvyType==4?i18n.sameDelivery:i18n.selectDeliveryMethod}}
						</view>
					</view>
				</view>
				<!-- /邮寄到家 -->

				<!-- 到店自提 -->
				<view class="address-box" v-if="!isDistribution">
					<view class="self-raising">
						<view class="tit">
							<view class="text">{{i18n.pickup}}</view>
						</view>
						<view class="choose-store" @tap="goSelectStore">
							<image src="/static/images/icon/submit-address.png" class="img"></image>
							<view class="text" v-if="selStationItem.province">
								{{selStationItem.province}}{{selStationItem.city}}{{selStationItem.area}}{{selStationItem.addr}}
							</view>
							<view class="text" v-if="!selStationItem.province">{{i18n.selectPickUpAddress}}</view>
						</view>
					</view>
					<view class="raising-user">
						<view class="tit">
							<view class="text" v-if="false">{{i18n.fillPersonInformation}}</view>
							<view class="text">{{i18n.historicalPickPerson}}</view>
							<view class="total" @tap="raisingUserList" v-if="stationUserInfo">
								{{i18n.inTotal}}{{stationUserInfo?stationUserInfo.length:'0'}}{{i18n.itemGe}}
							</view>
						</view>

						<view class="user-info">
							<input type="text" class="input" :disabled="disabled" :value="stationUserName"
								@input="getConsigneeInt" :placeholder="i18n.enterNamePerson" maxlength="15"
								@click="hideTabbar" @focus="hideTabbar" @blur="showTabbar" />
						</view>
						<view :class="['item',errorTips ? 'error':'']">
							<view class="user-info">
								<input type="text" class="input" :disabled="disabled" :value="stationUserMobile"
									@input="getConMobileInt" :placeholder="i18n.enterPhonePerson" maxlength="11"
									@click="hideTabbar" @focus="hideTabbar" @blur="showTabbar" />
							</view>
							<view class="error-text" v-if="errorTips==1"><text
									class="warning-icon">!</text>{{i18n.phoneWarn}}</view>
						</view>
					</view>
					<view class="choose-way" @tap="raisingTimePop">
						<view class="text">{{i18n.takeDeliveryTime}}</view>
						<view class="go">{{timeContent?dateContent+' '+timeContent:i18n.choosePickUpTime}}</view>
					</view>
				</view>
				<!-- /到店自提 -->

				<view class="shop-item">
					<view v-for="(shopCart, index) in shopCartOrders" :key="index">
						<!-- 店铺信息 -->
						<view class="shop-box">
							<view class="shop-icon">
								<image src="/static/images/icon/shop.png"></image>
							</view>
							<view class="shop-name">{{shopCart.shopName}}</view>
						</view>
						<!-- /店铺信息 -->

						<!-- 店铺商品明细 -->
						<view class="prod-item">
							<view v-for="(shopCartItem, index2) in shopCart.shopCartItemDiscounts" :key="index2">
								<view :class="['prod-block',shopCartItem.chooseDiscountItemDto?'discount':'']">
									<!-- 满减提示 -->
									<view class='discount-tips' :hidden='!shopCartItem.chooseDiscountItemDto'
										v-if="shopCartItem.chooseDiscountItemDto && preSellStatus!=1">
										<text
											class='text-block'>{{wxs.parseDiscount(shopCartItem.chooseDiscountItemDto.discountRule,curLang)}}</text>
										<text
											class='text-list'>{{wxs.parseDiscountMsg(shopCartItem.chooseDiscountItemDto.discountRule,shopCartItem.chooseDiscountItemDto.needAmount,shopCartItem.chooseDiscountItemDto.discount,curLang)}}</text>
										<text class="text-list reduce-amount">{{i18n.haveDiscount}}
											￥{{wxs.parsePrice(shopCartItem.chooseDiscountItemDto.reduceAmount)[0]}}.{{wxs.parsePrice(shopCartItem.chooseDiscountItemDto.reduceAmount,curLang)[1]}}</text>
									</view>

									<!-- 商品信息 -->
									<view class="item-box">
										<view :class="[preSellStatus==1?'pre-sell' : '','item-cont']"
											v-for="(item, prodId) in shopCartItem.shopCartItems" :key="prodId">
											<view class="prod-pic">
												<image :src="item.pic"></image>
											</view>
											<view class="prod-info">
												<view class="prodname">{{item.prodName}}</view>
												<view class="prod-info-cont">{{item.skuName}}</view>
												<view class="price-nums">
													<view class="prodprice">
														<text class="symbol">￥</text>
														<text class="big-num">{{wxs.parsePrice(item.price)[0]}}</text>
														<text
															class="small-num">.{{wxs.parsePrice(item.price)[1]}}</text>
													</view>
													<view class="prodcount">×{{item.prodCount}}</view>
												</view>
											</view>
										</view>
									</view>

								</view>
							</view>

						</view>
						<!-- /店铺商品明细 -->

						<!-- 店铺优惠券和买家留言 -->
						<view class="msg-item">
							<view class="item coupon" @tap="showCouponPopup" :data-index="index">
								<view class="text-box">
									<text class="text">{{i18n.coupon}}：</text>
									<text class="number"
										v-if="!shopCart.shopCoupons.canUseLength">{{i18n.notAvailable}}</text>
									<text class="number"
										v-else>{{shopCart.shopCoupons.canUseLength}}&nbsp;{{i18n.zhangAvailable}}</text>
								</view>
								<view class="amount" v-if="shopCart.shopCoupons.couponAmount>0">
									<text class="symbol">-￥</text>
									<text
										class="big-num">{{wxs.parsePrice(shopCart.shopCoupons.couponAmount)[0]}}</text>
									<text
										class="small-num">.{{wxs.parsePrice(shopCart.shopCoupons.couponAmount)[1]}}</text>
								</view>
							</view>
							<view class="item">
								<view class="tit">{{i18n.storeNotes}}：</view>
								<input class="input" maxlength="100" :placeholder="i18n.storeNotesTips"
									:value="shopCart.remarks" :data-index="index" @input="onRemarkIpt"
									@click="hideTabbar" @focus="hideTabbar" @blur="showTabbar" />
							</view>
						</view>
						<!-- /店铺优惠券和买家留言 -->
					</view>

					<!-- 不满足当前配送方式的商品 -->
					<view class="useless" v-if="filterShopItems && filterShopItems.length > 0">
						<view class="u-reason">
							{{i18n.productsNotSupported}}{{['',i18n.expressDelivery,i18n.pickStore,'',i18n.sameDelivery][dvyType]}}，{{i18n.chooseAnotherDelivery}}
						</view>
						<scroll-view scroll-x="true" class="u-con">
							<view class="u-box">
								<view class="u-prods" v-for="(item,index) in filterShopItems" :key="index">
									<image :src="item.pic"></image>
								</view>
							</view>
						</scroll-view>
					</view>

				</view>

				<!-- 总金额计算 -->
				<view class="order-msg">
					<!-- 平台优惠券 -->
					<view class="item bb" @tap="showCouponPopup" data-index="-1">
						<view class="text-box">
							<text class="tit">{{i18n.platformCoupons}}：</text>
							<text class="number" v-if="!platformCoupons.canUseLength">{{i18n.notAvailable}}</text>
							<text class="number" v-else>{{platformCoupons.canUseLength}}{{i18n.zhangAvailable}}</text>
						</view>
						<view class="amount" v-if="platformCoupons.couponAmount > 0">
							<text class="symbol">-￥</text>
							<text class="big-num">{{wxs.parsePrice(platformCoupons.couponAmount)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(platformCoupons.couponAmount)[1]}}</text>
						</view>
					</view>
					<!-- 会员积分 -->
					<view class="item coupon" v-if="maxUsableScore > 0 && preSellStatus!=1">
						<view class="member-points">
							<view class="integral-wrap">
								<view class="integral-deduction">
									<text class="tit">{{i18n.pointsDeduction}}： </text>
									<view class="integral-tips" v-if="isScorePay==1" @tap.stop="handleScorePop">
										<text class="tips"
											v-if="totalScoreAmount>0 && totalUsableScore>0">{{scorePlaceholder}}</text>
										<text class="tips" v-else>
											{{i18n.enterPoints}}
										</text>
										<image src="/static/images/icon/revise.png"></image>
										<view class="integral-right-select">
											<label>
												<checkbox color="#E43130" value="isScorePay" @tap.stop="useMemberPoints"
													:checked="isChecked"></checkbox>
											</label>
										</view>
									</view>
									<view class="integral-tips" v-if="isScorePay==0"> {{i18n.notUsePoints}}</view>
								</view>
							</view>
							<view class="integral-right-select" v-if="isScorePay==0">
								<label>
									<checkbox color="#E43130" value="isScorePay" @tap.stop="useMemberPoints"
										:checked="isChecked"></checkbox>
								</label>
							</view>
						</view>
					</view>
					<!-- 商品总额 -->
					<view class="item">
						<view class="item-tit">{{i18n.comTotal}}：</view>
						<view class="price black">
							<text class="symbol">￥</text>
							<text class="big-num">{{wxs.parsePrice(total)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(total)[1]}}</text>
						</view>
					</view>
					<!-- 运费 -->
					<view class="item">
						<view class="item-tit">{{i18n.prodTransfee}}：</view>
						<view class="price black">
							<text class="symbol">￥</text>
							<text class="big-num">{{wxs.parsePrice(transfee)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(transfee)[1]}}</text>
						</view>
					</view>
					<!-- 会员折扣金额 -->
					<view class="item" v-if="totalLevelAmount">
						<view class="item-tit">{{i18n.memberDiscountAmount}}：</view>
						<view class="price">
							<text class="symbol">-￥</text>
							<text class="big-num">{{wxs.parsePrice(totalLevelAmount)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(totalLevelAmount)[1]}}</text>
						</view>
					</view>
					<!-- 店铺优惠券优惠金额 -->
					<view class="item" v-if="storeOfferAmount">
						<view class="item-tit">{{i18n.storeCoupons}}：</view>
						<view class="price">
							<text class="symbol">-￥</text>
							<text class="big-num">{{wxs.parsePrice(storeOfferAmount)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(storeOfferAmount)[1]}}</text>
						</view>
					</view>
					<!-- 活动优惠金额 -->
					<view class="item" v-if="eventOfferAmount">
						<view class="item-tit">{{i18n.eventOffer}}：</view>
						<view class="price">
							<text class="symbol">-￥</text>
							<text class="big-num">{{wxs.parsePrice(eventOfferAmount)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(eventOfferAmount)[1]}}</text>
						</view>
					</view>
				</view>
				<!-- /总金额计算 -->
			</view>

			<!-- 腾讯地图组件 -->
			<view class="map" v-if="isMap">
				<view class="goOut" @click="isMapReturn">返回</view>
				<iframe id="mapPage" width="100%" height="100%" frameborder=0
					:src="`https://apis.map.qq.com/tools/locpicker?search=1&type=1&policy=1&key=${key}&referer=myappp`">
				</iframe>
				<!-- end 腾讯地图组件 -->
			</view>

			<!-- 底部栏 -->
			<view v-if="tabbar" class="submit-order-footer">
				<view class="sub-order">
					<view class="item-txt">{{i18n.total}}：<view class="price">
							<text class="symbol">￥</text>
							<text class="big-num">{{wxs.parsePrice(actualTotal)[0]}}</text>
							<text class="small-num">.{{wxs.parsePrice(actualTotal)[1]}}</text>
						</view>
					</view>
				</view>
				<view class="footer-box"
					:style="(filterShopItems && filterShopItems.length > 0 && shopCartOrders.length === 0)? 'background: #909399;' : 'background: #e43130;'"
					@tap="toPay">{{i18n.submitOrders}}</view>
			</view>
		</view>

		<!-- 选择优惠券弹窗 -->
		<view class="popup-hide" v-if="popupShow">
			<view class="popup-box">
				<view class="popup-tit">
					<text>{{i18n.coupon}}</text>
					<view class="close" @tap="closePopup"></view>
				</view>
				<view class="coupon-tabs">
					<view :class="'coupon-tab ' + (couponSts==1?'on':'')" @tap="changeCouponSts" data-sts="1">
						{{i18n.availableCoupons}}({{showCoupons.canUseCoupons.length}})
					</view>
					<view :class="'coupon-tab ' + (couponSts==2?'on':'')" @tap="changeCouponSts" data-sts="2">
						{{i18n.unavailableCoupons}}({{showCoupons.unCanUseCoupons.length}})
					</view>
				</view>
				<view :class="'popup-cnt ' + (couponSts==2? 'on':'')">
					<view class="coupon-con" v-if="couponSts == 1">
						<block v-for="(item, index) in showCoupons.canUseCoupons" :key="index">
							<coupon :item="item" :order="order" :index="index" @checkCoupon="checkCoupon"
								:canUse="isCanUse"></coupon>
						</block>
					</view>
					<view class="coupon-con" v-if="couponSts == 2">
						<block v-for="(item, index) in showCoupons.unCanUseCoupons" :key="index">
							<coupon :item="item" :order="order" :canUse="!isCanUse"></coupon>
						</block>
					</view>
					<view class="botm-empty" v-if="couponSts==1 && !showCoupons.canUseCoupons.length">
						{{i18n.getCouponTips}}
					</view>
					<view class="botm-empty" v-if="couponSts==2 && !showCoupons.unCanUseCoupons.length">
						{{i18n.NoRelevantCoupons}}
					</view>
				</view>
				<view class="coupon-ok" v-if="couponSts==1">
					<view class="btn" @tap="choosedCoupon">{{i18n.confirm}}</view>
				</view>
			</view>
		</view>
		<!-- 积分输入框弹窗 -->
		<view class="popup-hide" :hidden="!showScorePop">
			<view class="score-pop">
				<view class="popup-tit">
					<text>{{i18n.modifyDeductiblePoints}}</text>
					<view class="close" @tap="closePopup"></view>
				</view>
				<view class="score-pop-con">
					<view class="score-pop-item">
						<input class="score-int" type="number" :value="userUseScore" :placeholder="i18n.enterPoints"
							@input="handleScoreInput" maxlength="8" @click="hideTabbar" @focus="hideTabbar"
							@blur="showTabbar" />
						<text class="usable-tips">{{orderScorePlaceHolder}}</text>
						<view class="usable-tips" v-if="shopUseScore > 100">{{i18n.multipleOf10}}</view>
					</view>
					<view class="score-pop-item">
						<view class="confirm-btn" @tap="confirmScore">{{i18n.confirm}}</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 选择配送方式弹窗 -->
		<view class="popup-hide" :hidden="!showDistributionPop">
			<view class="popup-box height-auto">
				<view class="con-tit">
					<view class="close" @tap="closePopup"></view>
					<view class="tit-text">{{i18n.selectDeliveryMethod}}</view>
					<!-- <view class="sure"><image src="/static/images/icon/sure.png"></image></view> -->
				</view>
				<view class="pop-con">
					<!-- <view class="distribution-item">
						<view class="text">普通快递</view>
						<checkbox class="check" checked="isChecked"></checkbox>
					</view>
					<view class="distribution-item">
						<view class="text">同城配送</view>
						<checkbox class="check" checked="isChecked"></checkbox>
					</view> -->
					<radio-group @change="disRadioChange">
						<label class="distribution-item">
							<view class="text">{{i18n.expressDelivery}}</view>
							<radio color="#eb2444" class="check" value="1" :checked="dvyType==1"></radio>
						</label>
						<label class="distribution-item">
							<view class="text">{{i18n.sameDelivery}}</view>
							<radio color="#eb2444" class="check" value="4" :checked="dvyType==4"></radio>
						</label>
					</radio-group>

				</view>
			</view>
		</view>

		<!-- 可用地址弹窗 -->
		<view class="popup-hide" :hidden="!showAddressListPop">
			<view class="popup-box address-list">
				<view class="con-tit">
					<view class="close" @tap="closePopup"></view>
					<view class="tit-text">{{i18n.optionalAddress}}</view>
					<!-- <view class="sure"><image src="/static/images/icon/sure.png"></image></view> -->
				</view>
				<view class="address-box">
					<radio-group @change="addrRadioChange" v-for="(item, index) in addressList" :key="index">
						<view class="item" @tap="selectAddr(item)">
							<view class="text-box">
								<view class="address"><text class="default-address"
										v-if="item.commonAddr == 1">{{i18n.default}}</text>{{item.province}}{{item.city}}{{item.area}}{{item.addr}}
								</view>
								<view class="user">{{item.receiver}} {{item.mobile}}</view>
							</view>
							<radio color="#eb2444" class="check" :value="String(item.addrId)"
								:checked="addrId == item.addrId"></radio>
						</view>
					</radio-group>
				</view>
			</view>
		</view>

		<!-- 历史提货人弹窗 -->
		<view class="popup-hide" :hidden="!showRaisingUserList">
			<view class="popup-box address-list history-user">
				<view class="con-tit">
					<view class="close" @tap="closePopup"></view>
					<view class="tit-text">{{i18n.historicalPickPerson}}</view>
					<!-- <view class="sure"><image src="/static/images/icon/sure.png"></image></view> -->
				</view>
				<view class="address-box" v-if="stationUserInfo && stationUserInfo.length > 0">
					<radio-group @change="stationRadioChange" v-for="(item,index) in stationUserInfo" :key="index">
						<view class="item">
							<view class="text-box">
								<view class="address history-picker-user">
									<view class="gray">{{i18n.pickUpPerson}}：</view>
									<view>{{item.stationUserName}}</view>
								</view>
								<view class="address history-picker-user">
									<view class="gray">{{i18n.phoneNumber}}：</view>
									<view>{{item.stationUserMobile}}</view>
								</view>
							</view>
							<radio color="#eb2444" class="check" :value="String(index)" :checked="stationIdx == index"
								@tap="getStationItem(item)"></radio>
						</view>
					</radio-group>
				</view>
			</view>
		</view>

		<!-- 选择提货时间弹窗 -->
		<view class="popup-hide" :hidden="!showRaisingTimePop">
			<view class="popup-box raising-time">
				<view class="con-tit">
					<view class="tit-text">{{i18n.choosePickUpTime}}</view>
					<view class="close" @tap="closePopup"></view>
				</view>
				<view class="time-box">
					<view class="day-box" v-if="selStationItem && timeParams">
						<view :class="['item', dateIndex==dateIdx?'active':'']" v-for="(item,dateIdx) in timeParams"
							:key="dateIdx" @tap="changeData(item,dateIdx)">{{item.dateTime}}</view>
						<!-- <view class="item">07-10(后天)</view> -->
					</view>
					<block v-if="timeParams[dateIndex]">
						<view class="hour-box" v-if="timeParams[dateIndex].hourTimes">
							<radio-group v-for="(timeItem,timeIdx) in timeParams[dateIndex].hourTimes" :key="timeIdx">
								<view class="item" @tap="changeTime(timeItem,timeIdx)">
									<view :class="['number', timeIndex==timeIdx?'red-word':'']">{{timeItem}}</view>
									<radio color="#eb2444" class="check" :checked="timeIndex==timeIdx"
										:value="String(timeIdx)" v-if="timeIndex==timeIdx"></radio>
								</view>
							</radio-group>
						</view>
					</block>
				</view>
			</view>
		</view>


	</view>
</template>

<script module="wxs" lang="wxs" src="@/wxs/number.wxs"></script>

<script>
	var http = require("@/utils/http.js");
	var util = require("@/utils/util.js");
	var config = require("@/utils/config.js");
	var index = [18, 0, 0];
	var t = 0;
	var show = false;
	var moveY = 200;
	import coupon from "@/components/orderCoupon/coupon";
	import {
		PayType,
		AppType
	} from "@/utils/constant.js";
	import Wechat from "@/utils/wechat.js";
	import Pay from "@/utils/pay.js";
	export default {
		data() {
			return {
				popupShow: false,
				orderEntry: "0", // 订单入口 0购物车 1立即购买
				userAddr: null,
				orderItems: [],
				shopCartOrders: [],
				//所有店铺的数据
				couponSts: 1,
				platformCoupons: {
					canUseLength: 0,
					canUseCoupons: [],
					unCanUseCoupons: []
				},
				// 平台优惠券数据
				showCoupons: {
					canUseCoupons: [],
					unCanUseCoupons: []
				},
				actualTotal: 0,
				total: 0,
				totalCount: 0,
				transfee: 0,
				reduceAmount: 0, //减免金
				couponIds: [],
				userChangeCoupon: 0, // 用户有没有对优惠券进行改变
				orderReduce: 0,
				choose: true,
				totalScoreAmount: 0, //积分抵扣金额
				totalUsableScore: 0, //整个订单可以使用的积分数
				isScorePay: 0, //用户是否选择积分抵现(0不使用 1使用 默认不使用)
				isChecked: false, //是否选择会员积分抵现
				isProhibit: false, //（积分抵现）checkbox是否禁止
				totalLevelAmount: 0, //等级抵扣金额
				freeTransfee: 0, //用户等级免运费金额
				isCanUse: true,
				order: true,
				editorFlag: false, //用户点击编辑按钮所在区域隐藏
				userUseScore: '', // 积分数量
				scorePlaceholder: '', // 积分抵扣的占位符
				accountCanUseScore: 0, // 用户当前可用积分
				shopUseScore: '', // 积分抵现比例
				maxUsableScore: "", // 最大可用积分
				showScorePop: false, // 积分输入弹窗显隐
				isEditAddr: false, // 编辑地址
				showDistributionPop: false, // 选择物流方式弹窗
				addressList: [], // 地址列表
				showAddressListPop: false, // 可用地址弹窗
				isDistribution: true, // 配送方式tab状态
				showRaisingUserList: false, //选择历史提货人弹窗
				showRaisingTimePop: false, //选择提货时间弹窗
				dvyType: 1, // 配送类型 1:快递 2:自提 3：无需快递 4:同城配送
				filterShopItems: [], // 过滤掉的商品项
				value: [0, 0, 0],
				provArray: [],
				cityArray: [],
				areaArray: [],
				province: "",
				city: "",
				area: "",
				provinceId: 0,
				cityId: 0,
				areaId: 0,
				receiver: "",
				mobile: "",
				addr: "",
				addrId: 0,
				animation: "",
				show: "",
				saveEditFlag: false, //弹窗确认选择地址
				region: "",
				stationUserName: '', // 提货人
				stationUserMobile: '', // 提货人手机号
				stationUserInfo: [], //历史提货人
				stationIdx: null, // 历史提货人选中index
				selStationItem: {}, // 选中的自提点数据
				timeParams: [],
				dateIndex: 0, // 日期下标
				timeIndex: null, // 时间下标
				timeContent: '', // 选中的时间
				dateContent: '', // 选中的日期
				selectDistributionWay: true, // 选择订单发货方式
				orderScorePlaceHolder: '', // 积分弹窗输入框订单可使用积分提示占位符
				disabled: false, // 是否禁止输入框输入
				selStation: '', // 是否选择自提点
				errorTips: 0, //错误提示
				tabbar: true,
				// 获取屏幕高度
				windowHeight: '',
				// 判断是否输入了地址
				boolenRes: 1, //1地址确认状态  //0地址未确认状态
				preSellStatus: '', // 是否预售商品
				curLang: uni.getStorageSync('lang'),
				storeOfferAmount: 0, //店铺优惠
				eventOfferAmount: 0, //活动优惠
				key: 'L4DBZ-VSSKJ-GCDFX-KGBVR-KHZ2J-RNF2Q',
				isMap: false,
				isFirst: true
			};
		},

		computed: {
			i18n() {
				return this.$t('index')
			}
		},

		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			this.setData({
				orderEntry: options.orderEntry
			});
			if (options.dvyType) {
				this.dvyType = options.dvyType
			}
			if (this.dvyType == 1 || this.dvyType == 4) { // 同城 || 邮寄
				this.isDistribution = true
			} else if (this.dvyType == 2) { // 自提
				this.isDistribution = false
			}
			this.initCityData(this.provinceId, this.cityId, this.areaId)
			this.loadAddressList() //加载地址列表
		},

		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {
			this.animation = wx.createAnimation({
				transformOrigin: "50% 50%",
				duration: 0,
				timingFunction: "ease",
				delay: 0
			});
			this.animation.translateY(200 + 'vh').step();
			this.setData({
				animation: this.animation.export(),
				show: show
			});
		},

		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			// 设置头部导航标题
			uni.setNavigationBarTitle({
				title: this.i18n.submitOrders
			});

			var pages = getCurrentPages();
			var currPage = pages[pages.length - 1];
			if (currPage.selStation == "yes") {
				this.setData({ //将携带的参数赋值
					selStationItem: currPage.selStationItem,
					timeParams: currPage.selStationItem.timeParams
				})
			}
			// 获取当前可用积分
			this.getUserLevelInfo()
			this.loadOrderData()
		},

		methods: {

			/**
			 * 腾讯地图以及微信小程序详细地址请求
			 */
			selMap() {
				// #ifdef H5
				this.isMap = true
				this.tabbar = false
				let that = this
				window.addEventListener('message', function(event) {
					// 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息
					var loc = event.data
					if (loc && loc.module ===
						'locationPicker') { // 防止其他应用也会向该页面post信息，需判断module是否为'locationPicker'
						that.addr = loc.poiaddress
						that.lat = loc.latlng.lat
						that.lng = loc.latlng.lng
						that.isMap = false
						that.tabbar = true
					}
				}, false)
				// #endif

				// #ifdef MP-WEIXIN
				let that = this
				uni.chooseLocation({
					success: function(res) {
						that.setMapData(res);
					},
					fail: function(failMsg) {
						// #ifdef MP-WEIXIN
						uni.getSetting({
							success(res) {
								if (!res.authSetting['scope.userLocation']) {
									console.log("f1");
									uni.authorize({
										scope: 'scope.userLocation',
										success() {
											uni.chooseLocation({
												success: function(res) {
													that.setMapData(res);
													console.log(res)
												}
											})
										},
										fail() {
											uni.showToast({
												title: that.i18n.authorityTips,
												icon: 'none'
											});
										}
									});
								}
							}
						});
						// #endif
					}
				});
				// #endif
			},

			isMapReturn() {
				this.isMap = false;
				this.tabbar = true;
			},

			// 提交订单浮框的显隐
			showTabbar() {
				if (this.disabled == false) {
					this.tabbar = true
				}
			},
			hideTabbar() {
				if (this.disabled == false) {
					this.tabbar = true
				}
			},
			// 切换配送方式
			changeDistribution: function(sts) { // 邮寄或同城
				if (sts == 0) {
					this.isDistribution = true
					this.dvyType = 1
				} else if (sts == 1) { // 自提
					this.isDistribution = false
					this.dvyType = 2
				}
				this.loadOrderData()
			},

			// 选择配送方式
			disRadioChange(e) {
				this.dvyType = e.detail.value
				this.loadOrderData()
				this.showDistributionPop = false
			},

			// 选择地址
			addrRadioChange(e) {
				console.log(e)
				this.addrId = e.detail.value
				this.showAddressListPop = false
				this.isEditAddr = false
				this.getAddrDet()
			},
			selectAddr: function(item) {
				console.log(item)
				this.addrId = item.addrId
				this.showAddressListPop = false
				this.isEditAddr = false
				this.getAddrDet()
				this.setData({
					boolenRes: 1
				})
			},

			// 选择历史提货人
			stationRadioChange(e) {
				console.log(e)
				this.stationIdx = e.detail.value
				this.showRaisingUserList = false
				this.raisingUserList()
			},
			getStationItem: function(item) {
				this.stationUserName = item.stationUserName
				this.stationUserMobile = item.stationUserMobile
				this.showRaisingUserList = false
				console.log(item)
				console.log('提货人：', this.stationUserName)
				console.log('提货人手机号：', this.stationUserMobile)
			},

			// 加载地址列表
			loadAddressList: function() {
				var ths = this;
				wx.showLoading();
				var params = {
					url: "/p/address/list",
					method: "GET",
					data: {},
					callBack: function(res) {
						ths.setData({
							addressList: res
						});
						wx.hideLoading();
					}
				};
				http.request(params);
			},
			//根据地址id请求地址详情
			getAddrDet: function() {
				wx.showLoading();
				var params = {
					url: "/p/address/addrInfo/" + this.addrId,
					method: "GET",
					data: {},
					callBack: (res) => {
						wx.hideLoading();
						console.log(res)
						this.userAddr = res
						this.loadOrderData()
						this.addr = ''
					}
				};
				http.request(params);
			},

			/**
			 * 获取会员积分详情
			 */
			getUserLevelInfo() {
				var params = {
					url: '/p/score/scoreInfo',
					method: 'GET',
					dontTrunLogin: true,
					data: {},
					callBack: res => {
						this.setData({
							accountCanUseScore: res.score
						});
					}
				};
				http.request(params);
			},

			// 会员积分抵现选择
			useMemberPoints: function() {
				this.isChecked = !this.isChecked;
				if (this.maxUsableScore > 0) {
					//totalUsableScore整个订单可以使用的积分数
					this.setData({
						isScorePay: this.isChecked ? 1 : 0,
						userUseScore: this.isChecked ? this.maxUsableScore : 0
					});
					this.loadOrderData();
				}
			},

			/**
			 * 积分输入弹窗显示
			 */
			handleScorePop() {
				this.setData({
					showScorePop: true
				});
			},

			/**
			 * 积分抵扣输入框
			 */
			handleScoreInput(e) {
				this.userUseScore = Number(e.detail.value.replace(/[^\d]/g, ''))
			},

			/**
			 * 修改积分确定弹窗
			 */
			confirmScore() {
				if (!this.userUseScore || this.userUseScore < 0) {
					uni.showToast({
						title: this.i18n.enterCorrectPoints,
						icon: 'none'
					})
					return
				}
				if (this.userUseScore > this.maxUsableScore) {
					uni.showToast({
						title: this.i18n.mostUserPoints + this.maxUsableScore + this.i18n.integral,
						icon: 'none'
					});
					return
				}
				if (this.userUseScore > this.accountCanUseScore) {
					uni.showToast({
						title: this.i18n.notEnough,
						icon: 'none'
					})
					return
				}
				this.loadOrderData();
				this.closePopup();
			},

			//加载订单数据
			loadOrderData: function(flag) {
				var addrId = 0;
				if (this.userAddr != null) {
					addrId = this.userAddr.addrId;
				}
				uni.showLoading({
					mask: true
				});
				var params = {
					url: "/p/order/confirm",
					method: "POST",
					data: {
						addrId: addrId,
						orderItem: this.orderEntry === "1" ? JSON.parse(wx.getStorageSync("orderItem")) :
							undefined,
						basketIds: this.orderEntry === "0" ? JSON.parse(wx.getStorageSync("basketIds")) :
							undefined,
						couponIds: this.couponIds,
						dvyType: this.dvyType, // 配送类型 1:快递 2:自提 3：无需快递 4:同城配送
						userChangeCoupon: this.userChangeCoupon,
						isScorePay: this.isScorePay,
						userUseScore: this.userUseScore ? this.userUseScore : 0
					},
					callBack: res => {
						uni.hideLoading();
						var shopCartOrders = res.shopCartOrders; // 购物车店铺商品信息列表
						var remarksList = []
						var couponIds = []
						var storeOfferAmount = 0
						var eventOfferAmount = 0
						if (!this.isFirst) {
							this.shopCartOrders.forEach(el => {
								remarksList.push(el.remarks)
							})
						}
						shopCartOrders.forEach((shopCart, index) => {
							// storeOfferAmount = storeOfferAmount + shopCart.couponReduce - shopCart.platformAmount
							// storeOfferAmount +=  (shopCart.couponReduce - shopCart.platformAmount)

							if (this.isFirst) {
								shopCart.remarks = '';
							} else {
								shopCartOrders[index].remarks = remarksList[index]
							}
							shopCart.shopCoupons = this.splitCouponAndPushCouponIds(shopCart.coupons,
								couponIds);
							storeOfferAmount += shopCart.shopCoupons.couponAmount
							eventOfferAmount += shopCart.discountReduce
						});
						// 平台优惠券
						var platformCoupons = this.splitCouponAndPushCouponIds(res.coupons, couponIds);

						// 运费
						var transfee = res.totalTransfee - res.freeTransfee

						var scorePlaceholder = this.i18n.use + ' ' + res.totalUsableScore + ' ' + this.i18n
							.pointsDeduction + ' ' + res.totalScoreAmount + this.i18n.yuan;
						var orderScorePlaceHolder = this.i18n.accountSurplus + ' ' + this.accountCanUseScore +
							' ' + this.i18n.accountSurplus2 + ' ' + res.maxUsableScore;

						this.setData({
							platformCoupons: platformCoupons, //整个订单可以使用的优惠券列表
							shopCartOrders: shopCartOrders, //所有的店铺的购物车信息
							actualTotal: res.actualTotal, //实际总值
							total: res.total, //商品总值
							totalCount: res.totalCount, //商品总数
							userAddr: res.userAddr, //地址Dto
							transfee: transfee, //总运费
							orderReduce: res.orderReduce, //订单优惠金额(所有店铺优惠金额和使用积分抵现相加)
							totalScoreAmount: res.totalScoreAmount, //积分抵扣金额
							totalUsableScore: res.totalUsableScore, //使用的积分数量
							isScorePay: res.isScorePay, //用户是否选择积分抵现(0不使用 1使用 默认不使用)
							totalLevelAmount: res.totalLevelAmount, //等级抵扣金额
							freeTransfee: res.freeTransfee, //用户等级免运费金额
							couponIds: couponIds,
							maxUsableScore: res.maxUsableScore, //整个订单可以使用的积分数
							// scorePlaceholder: `使用${res.totalUsableScore}积分抵扣${res.totalScoreAmount}元`,
							// orderScorePlaceHolder: `账户剩余${this.accountCanUseScore}积分, 该订单最大可用${res.maxUsableScore}`,
							scorePlaceholder: scorePlaceholder,
							orderScorePlaceHolder: orderScorePlaceHolder,
							shopUseScore: res.shopUseScore, // 积分抵现比例;
							filterShopItems: res.filterShopItems, // 过滤掉的商品项
							preSellStatus: res.preSellStatus, //	是否预售商品
							storeOfferAmount: storeOfferAmount, //店铺优惠券优惠
							eventOfferAmount: eventOfferAmount, //活动优惠
							isFirst: false
						});
						if (this.shopCartOrders.length > 1) {
							this.selectDistributionWay = false
						}
						this.disabledInput() // 是否禁止提货人输入框输入
						if (this.dvyType === 2) {
							this.getStationUserInfo() // 历史提货人
						}
					},
					errCallBack: err => {
						uni.hideLoading()
						uni.showModal({
							title: this.i18n.tips,
							content: err.data,
							showCancel: false, //是否显示取消按钮
							confirmText: this.i18n.confirm,
							success: (modalSuccess) => {
								if (modalSuccess.confirm) {
									uni.navigateBack({
										delta: 1,
									})
								}
							}
						})
					}
				};
				http.request(params);
			},

			/**
			 * 分割优惠券成
			 * 1. canUseCoupons 可使用优惠券列表
			 * 2. unCanUseCoupons 不可使用优惠券列表
			 * 3. couponAmount 选中的优惠券可优惠金额
			 * 4. 将选中的优惠券ids保存起来
			 * @param {*} coupons 优惠券列表
			 * @param {*} couponIds 选中的优惠券id
			 */
			splitCouponAndPushCouponIds(coupons, couponIds) {
				if (!coupons || !coupons.length) {
					return {
						canUseLength: 0,
						couponAmount: 0,
						canUseCoupons: [],
						unCanUseCoupons: []
					}
				}

				let canUseCoupons = [];
				let unCanUseCoupons = [];
				let couponAmount = 0;
				coupons.forEach(coupon => {
					if (coupon.canUse) {
						canUseCoupons.push(coupon);
					} else {
						unCanUseCoupons.push(coupon);
					}

					if (coupon.choose) {
						couponIds.push(coupon.couponId);
						couponAmount = coupon.reduceAmount;
					}
				});
				return {
					canUseLength: canUseCoupons.length,
					couponAmount: couponAmount,
					canUseCoupons: canUseCoupons,
					unCanUseCoupons: unCanUseCoupons
				};
			},

			/**
			 * 提交订单校验
			 */
			toPay: function() {

				if (this.dvyType != 2) {
					if (!this.userAddr) {
						wx.showToast({
							title: this.i18n.pleaseSelectSddress,
							icon: "none"
						});
						return;
					}
					if (!this.shopCartOrders.length) {
						var title = this.dvyType == 1 ? this.i18n.expressDelivery : this.dvyType == 4 ? this.i18n
							.sameDelivery : ''
						wx.showToast({
							title: this.i18n.productNotSupported + title,
							icon: "none"
						});
						return;
					}
					if (this.dvyType == 4 && (!this.userAddr.lat || this.userAddr.lat == 0 || !this.userAddr.lng ||
							this.userAddr.lng ==
							0)) {
						wx.showModal({
							title: this.i18n.tips,
							content: this.i18n.cityAddressPrompt,
							showCancel: false,
							confirmText: this.i18n.confirm,
							success: res => {
								uni.navigateTo({
									url: '/packageUser/pages/editAddress/editAddress?addrId=' + this.userAddr
										.addrId
								})
							}
						})
						// wx.showToast({
						// 	title: this.i18n.cityAddressPrompt,
						// 	icon: "none",
						// 	duration: 3000
						// });
						return;
					}
				} else if (this.dvyType == 2) {
					if (!this.shopCartOrders.length) {
						wx.showToast({
							title: this.i18n.productNotSupportedStop,
							icon: "none"
						});
						return;
					}
					if (!this.selStationItem.province) {
						wx.showToast({
							title: this.i18n.selectPickPoint,
							icon: "none"
						});
						return;
					}
					if (!this.stationUserName || !this.stationUserMobile) {
						wx.showToast({
							title: this.i18n.fillDeliveryPersonInformation,
							icon: "none"
						});
						return;
					}
					if (!util.checkPhoneNumber(this.stationUserMobile)) {
						wx.showToast({
							title: this.i18n.enterCorrectPhone,
							icon: "none"
						});
						return;
					}
					if (!this.dateContent || !this.timeContent) {
						wx.showToast({
							title: this.i18n.selectPickUpTime,
							icon: "none"
						});
						return;
					}
				}

				// 点击地址判断
				if (!this.boolenRes || this.addressList[0] === undefined) {
					console.log(this.addressList[0] === undefined);
					uni.showToast({
						title: this.i18n.saveAndUseTips,
						icon: 'none'
					})
					return
				}

				// 积分按钮选择判断
				if (this.isScorePay == 1 && this.userUseScore <= 0) {
					console.log()
					uni.showToast({
						title: this.i18n.enterPoints,
						icon: 'none'
					})
					return
				}

				this.submitOrder();
			},

			// 提交订单
			submitOrder: function() {
				var isPurePoints = this.actualTotal > 0 ? '' : 1 // 是否纯积分: 1是

				uni.showLoading({
					mask: true
				});
				var shopCartOrders = this.shopCartOrders;
				var orderShopParam = [];
				shopCartOrders.forEach(shopCart => {
					orderShopParam.push({
						remarks: shopCart.remarks,
						shopId: shopCart.shopId
					});
				});
				var orderSelfStationDto = {
					stationId: this.selStationItem.stationId,
					stationTime: this.dateContent + ' ' + this.timeContent,
					stationUserMobile: this.stationUserMobile,
					stationUserName: this.stationUserName
				}
				var params = {
					url: "/p/order/submit",
					method: "POST",
					data: {
						orderShopParam: orderShopParam,
						// coupons: this.data.platformCoupons,
						coupons: this.coupons,
						isScorePay: this.isScorePay,
						orderSelfStationDto: orderSelfStationDto
					},
					callBack: res => {
						uni.hideLoading();
						if (res.duplicateError != null && res.duplicateError == 1) {
							uni.showModal({
								title: this.i18n.tips,
								content: this.i18n.orderStatusChanged,
								confirmText: this.i18n.confirm,
								showCancel: false,
								success: (errModSuccess) => {
									if (errModSuccess.confirm) {
										uni.navigateBack({
											delta: 1,
										})
									}
								}
							})
						} else {
							this.$Router.replace({
								path: '/packageProduct/pages/payWay/payWay',
								query: {
									orderNumbers: res.orderNumbers,
									dvyType: this.dvyType,
									isPurePoints: isPurePoints
								}
							});
						}

					}
				};
				http.request(params);
			},

			// 店铺切换可用/不可用优惠券列表
			changeCouponSts: function(e) {
				this.setData({
					couponSts: e.currentTarget.dataset.sts
				});
			},
			// 店铺优惠券弹框
			showCouponPopup: function(e) {
				var index = e.currentTarget.dataset.index;
				var shopCartOrders = this.shopCartOrders;
				this.setData({
					showCoupons: index + '' === '-1' ? this.platformCoupons : shopCartOrders[index]
						.shopCoupons,
					popupShow: true,
				});
			},
			closePopup: function() {
				this.setData({
					popupShow: false,
					showScorePop: false,
					showDistributionPop: false,
					showAddressListPop: false,
					showRaisingUserList: false,
					showRaisingTimePop: false
				});
			},

			/**
			 * 去地址页面
			 */
			toAddrListPage: function() {
				this.isEditAddr = true
				this.setData({
					boolenRes: 0,
					addrId: '',
					editorFlag: false,
					province: null,
					city: null,
					area: null,
				})
			},

			/**
			 * 确定选择好的优惠券
			 */
			choosedCoupon: function() {
				var couponIds = this.couponIds; // 店铺优惠券单选操作
				if (!this.showCoupons) {
					this.setData({
						popupShow: false
					})
					return
				}
				var canUseCoupons = this.showCoupons.canUseCoupons;
				var checkedCouponId = ''
				for (var canUseCouponIndex in canUseCoupons) {
					var coupon = canUseCoupons[canUseCouponIndex];
					if (!coupon.choose && couponIds.indexOf(coupon.couponId) !== -1) {
						couponIds.splice(couponIds.indexOf(coupon.couponId), 1)
					}
					if (coupon.choose) {
						checkedCouponId = coupon.couponId
					}
				}
				couponIds.push(checkedCouponId)
				this.setData({
					couponIds: couponIds,
					popupShow: false
				});
				this.loadOrderData();
			},

			/**
			 * 优惠券子组件发过来
			 */
			checkCoupon: function(e) {
				var showCoupons = this.showCoupons; // 店铺优惠券单选操作

				var canUseCoupons = showCoupons.canUseCoupons;

				for (var canUseCouponIndex in canUseCoupons) {
					if (e.couponId == canUseCoupons[canUseCouponIndex].couponId && canUseCouponIndex == e.index) {
						canUseCoupons[canUseCouponIndex].choose = !canUseCoupons[canUseCouponIndex].choose;
					} else {
						canUseCoupons[canUseCouponIndex].choose = false;
					}
				}
				this.setData({
					showCoupons: showCoupons,
					userChangeCoupon: 1
				});
			},

			/**
			 * 输入备注
			 */
			onRemarkIpt: function(e) {
				var index = e.currentTarget.dataset.index;
				var shopCartOrders = this.shopCartOrders;
				shopCartOrders[index].remarks = e.detail.value;
				this.setData({
					shopCartOrders: shopCartOrders
				});
			},

			/**
			 * 物流选择弹窗显示
			 */
			distributionPop() {
				this.setData({
					showDistributionPop: true
				});
			},

			/**
			 * 可用地址弹窗显示
			 */
			AddressListPop() {
				if (this.addressList.length) {
					this.setData({
						showAddressListPop: true
					});
				}
			},

			/**
			 * 历史提货人弹窗显示
			 */
			raisingUserList() {
				if (this.dvyType == 2 && !this.shopCartOrders.length) {
					uni.showToast({
						title: this.i18n.productNotSupportedStop,
						icon: 'none'
					})
					return
				}
				this.setData({
					showRaisingUserList: true
				});

			},

			/**
			 * 选择提货时间弹窗显示
			 */
			raisingTimePop() {
				if (!this.selStationItem.province) {
					uni.showToast({
						title: this.i18n.selectPickPoint,
						icon: 'none'
					})
				} else {
					this.setData({
						showRaisingTimePop: true
					});
					let a = (this.timeParams[0].dateTime).split('-')
					this.dateContent = a[0] + this.i18n.virtualMonth + a[1] + this.i18n.dayOfAMonth
				}
			},

			/**
			 * 选择自提点
			 */
			goSelectStore() {
				if (!this.shopCartOrders.length) {
					wx.showToast({
						title: this.i18n.productNotSupportedStop,
						icon: "none"
					});
					return;
				}
				// 选择与重新选择自提点时时间
				this.setData({
					dateIndex: 0, // 日期下标
					timeIndex: null, // 时间下标
					timeContent: '', // 选中的时间
					dateContent: '', // 选中的日期
				})
				uni.navigateTo({
					url: '/pages/selectStore/selectStore?shopId=' + this.shopCartOrders[0].shopId
				});
			},

			/**
			 * 禁止输入提货人信息
			 */
			disabledInput: function() {
				if (this.dvyType == 2 && !this.shopCartOrders.length) {
					this.disabled = true
				} else {
					this.disabled = false
				}
			},

			/**
			 * 获取历史提货人列表
			 */
			getStationUserInfo: function() {
				wx.showLoading();
				var params = {
					url: "/p/orderSelfStation/getStationUserInfo",
					method: "GET",
					data: {},
					callBack: (res) => {
						wx.hideLoading();
						this.stationUserInfo = res
					}
				};
				http.request(params);
			},

			getConsigneeInt: function(e) {
				this.stationUserName = e.detail.value
			},
			getConMobileInt: function(e) {
				this.stationUserMobile = e.detail.value
			},

			/**
			 * 改变预约自提日期选择
			 */
			changeData: function(item, dateIdx) {
				this.dateIndex = dateIdx
				// console.log(this.dateIndex, this.timeParams[this.dateIndex].hourTimes)

				// 点击日期时默认选中第一个时间段
				this.timeIndex = 0; // 时间下标
				this.timeContent = this.timeParams[this.dateIndex].hourTimes[0];

				let a = (item.dateTime).split('-')

				this.dateContent = a[0] + '-' + a[1]

			},

			/**
			 * 改变预约自提时间选择
			 */
			changeTime: function(timeItem, timeIdx) {
				this.timeIndex = timeIdx
				console.log(this.timeIndex)
				this.showRaisingTimePop = false
				this.timeContent = timeItem
				console.log(timeItem)
				console.log(this.timeContent)
			},


			/**
			 * 获取当前日期零点的时间戳
			 * @param date
			 */
			getStartTimestampOfDay: function() {
				let d = new Date
				// let c = d.toISOString()
				// let b= c.replace(/\d{2}:\d{2}:\d{2}\.\d{3}/g, "00:00:00.000")
				let n = d.getTime()
				console.log(n)
				return n
			},

			/**
			 * 处理当前日期与指定日期之间的关系
			 * @param date
			 */
			getWeekDayMappingOfCurrent: function() {
				const current = this.getStartTimestampOfDay();
				console.log(current)
				if (current) {
					return {
						[current - 2 * 86400000]: this.i18n.beforeYesterday,
						[current - 1 * 86400000]: this.i18n.yesterday,
						[current]: this.i18n.today,
						[current + 1 * 86400000]: this.i18n.tomorrow,
						[current + 2 * 86400000]: this.i18n.afterTomorrow
					};
				}
				return {};
			},

			/**
			 * 获取全部省份
			 */
			initCityData: function(provinceId, cityId, areaId) {
				var ths = this;
				wx.showLoading();
				var params = {
					url: "/p/area/listByPid",
					method: "GET",
					data: {
						pid: 0
					},
					callBack: function(res) {
						ths.setData({
							provArray: res
						});
						if (provinceId) {
							for (var index in res) {
								if (res[index].areaId == provinceId) {
									ths.setData({
										value: [Number(index), ths.value[1], ths.value[2]]
									});
								}
							}
						}
						ths.getCityArray(provinceId ? provinceId : res[0].areaId, cityId, areaId);
						wx.hideLoading();
					}
				};
				http.request(params);
			},

			/**
			 * 根据省份ID获取 城市数据
			 */
			getCityArray: function(provinceId, cityId, areaId) {
				wx.showLoading();
				var ths = this;
				var params = {
					url: "/p/area/listByPid",
					method: "GET",
					data: {
						pid: provinceId
					},
					callBack: function(res) {
						//console.log(res)
						ths.setData({
							cityArray: res
						});

						if (cityId) {
							for (var index in res) {
								if (res[index].areaId == cityId) {
									ths.setData({
										value: [ths.value[0], Number(index), Number(ths.value[2])]
									});
								}
							}
						}

						ths.getAreaArray(cityId ? cityId : res[0].areaId, areaId);
						wx.hideLoading();
					}
				};
				http.request(params);
			},

			/**
			 * 根据城市ID获取 区数据
			 */
			getAreaArray: function(cityId, areaId) {
				var ths = this;
				var params = {
					url: "/p/area/listByPid",
					method: "GET",
					data: {
						pid: cityId
					},
					callBack: function(res) {
						//console.log(res)
						ths.setData({
							areaArray: res
						});

						if (areaId) {
							for (var _index in res) {
								if (res[_index].areaId == areaId) {
									ths.setData({
										value: [ths.value[0], ths.value[1], Number(_index)]
									});
								}
							}

							index = ths.value;
							ths.setData({
								province: ths.province,
								city: ths.city,
								area: ths.area,
								provinceId: ths.provinceId,
								cityId: ths.cityId,
								areaId: ths.areaId
							});
						} else {
							ths.setData({
								province: ths.provArray[ths.value[0]].areaName,
								city: ths.cityArray[ths.value[1]].areaName,
								area: ths.areaArray[ths.value[2]].areaName,
								provinceId: ths.provArray[ths.value[0]].areaId,
								cityId: ths.cityArray[ths.value[1]].areaId,
								areaId: ths.areaArray[ths.value[2]].areaId
							});
						}

						wx.hideLoading();
					}
				};
				http.request(params);
			},


			bindRegionChange: function(e) {
				//console.log('picker发送选择改变，携带值为', e.detail.value)
				this.setData({
					region: e.detail.value
				});
			},

			onReceiverInput: function(e) {
				this.setData({
					receiver: e.detail.value
				});
			},
			onMobileInput: function(e) {
				this.setData({
					mobile: e.detail.value
				});
			},
			onAddrInput: function(e) {
				this.setData({
					addr: e.detail.value
				});
			},

			/**
			 * 保存地址
			 */
			onSaveAddr: function() {
				var receiver = this.receiver;
				var mobile = this.mobile;
				var addr = this.addr;
				if (this.addressList.length == 10) {
					wx.showToast({
						title: this.i18n.newAddressesLimit,
						icon: "none",
						duration: 1500
					});
					return;
				}
				if (!receiver) {
					wx.showToast({
						title: this.i18n.consigneeTips,
						icon: "none"
					});
					return;
				}
				if (!mobile) {
					wx.showToast({
						title: this.i18n.enterMobileNumber,
						icon: "none"
					});
					return;
				}
				if (!util.checkPhoneNumber(mobile)) {
					wx.showToast({
						title: this.i18n.enterCorrectPhone,
						icon: "none"
					});
					return;
				}
				if (!this.province || !this.city || !this.area) {
					wx.showToast({
						title: this.i18n.selectProvinceCity,
						icon: "none"
					});
					return;
				}
				if (!addr || addr.length < 5) {
					wx.showToast({
						title: this.i18n.selectDetailedAddress,
						icon: "none"
					});
					return;
				}
				if (this.dvyType == 4) {
					// 同城配送
					if (!this.lat || !this.lng || this.lat == '' || this.lng == '') {
						uni.showModal({
							title: this.i18n.tips,
							content: this.i18n.selectCoordinates,
							showCancel: false,
							success: res => {
								this.chooseLocation()
							}
						})
					}
				}

				wx.showLoading();
				var url = "/p/address/addAddr";
				var method = "POST";
				//添加或修改地址
				var params = {
					url: url,
					method: method,
					data: {
						receiver: this.receiver,
						mobile: this.mobile,
						addr: this.addr,
						province: this.province,
						provinceId: this.provinceId,
						city: this.city,
						cityId: this.cityId,
						areaId: this.areaId,
						area: this.area,
						userType: 0,
						// addrId: this.addrId,
						lat: this.lat, // 纬度
						lng: this.lng, // 经度
					},
					callBack: (res) => {
						wx.hideLoading();
						this.loadAddressList()
						wx.showToast({
							title: this.i18n.savedSuccessfully,
							icon: 'none',
							duration: 1000
						})
						this.addr = ''
						this.receiver = ''
						this.mobile = ''
						this.province = ''
						this.city = ''
						this.area = ''
						this.isEditAddr = false
						if (this.addressList.length > 1) {
							setTimeout(() => {
								this.addrId = this.addressList[1].addrId
							}, 100);
						} else {
							setTimeout(() => {
								this.addrId = this.addressList[0].addrId
							}, 100);
						}

						this.setData({
							province: this.provArray[this.value[0]].areaName,
							city: this.cityArray[this.value[1]].areaName,
							area: this.areaArray[this.value[2]].areaName,
							provinceId: this.provArray[this.value[0]].areaId,
							cityId: this.cityArray[this.value[1]].areaId,
							areaId: this.areaArray[this.value[2]].areaId,
							boolenRes: 1
						});
						// this.showAddressListPop = true
						setTimeout(() => {
							this.getAddrDet()
						}, 100);
					}
				};
				http.request(params);
			},

			//滑动事件
			bindChange: function(e) {
				var val = e.detail.value; //判断滑动的是第几个column
				//若省份column做了滑动则定位到地级市和区县第一位

				if (index[0] != val[0]) {
					val[1] = 0;
					val[2] = 0; //更新数据
					this.getCityArray(this.provArray[val[0]].areaId); //获取地级市数据
				} else {
					//若省份column未做滑动，地级市做了滑动则定位区县第一位
					if (index[1] != val[1]) {
						val[2] = 0; //更新数据
						this.getAreaArray(this.cityArray[val[1]].areaId); //获取区县数据
					} else {}
				}

				index = val;
				this.setData({
					value: [val[0], val[1], val[2]]
				});
				if (this.province) {
					this.setData({
						province: this.provArray[this.value[0]].areaName,
						city: this.cityArray[this.value[1]].areaName,
						area: this.areaArray[this.value[2]].areaName,
						provinceId: this.provArray[this.value[0]].areaId,
						cityId: this.cityArray[this.value[1]].areaId,
						areaId: this.areaArray[this.value[2]].areaId
					});

				}

			},

			//移动按钮点击事件
			translate: function(e) {
				if (t == 0) {
					moveY = 0;
					show = false;
					t = 1;
				} else {
					moveY = 200;
					show = true;
					t = 0;
				}

				this.setData({
					show: true
				}); // this.animation.translate(arr[0], arr[1]).step();

				this.animationEvents(this, moveY, show);
			},

			//隐藏弹窗浮层
			hiddenFloatView(e) {

				moveY = 200;
				show = true;
				t = 0;
				this.animationEvents(this, moveY, show);
				this.setData({
					saveEditFlag: true
				})

				this.setData({
					province: this.provArray[this.value[0]].areaName,
					city: this.cityArray[this.value[1]].areaName,
					area: this.areaArray[this.value[2]].areaName,
					provinceId: this.provArray[this.value[0]].areaId,
					cityId: this.cityArray[this.value[1]].areaId,
					areaId: this.areaArray[this.value[2]].areaId
				});


			},

			// 点击屏幕外事件
			hiddenFloatViewScreenClick(e) {
				moveY = 200;
				show = true;
				t = 0;
				this.animationEvents(this, moveY, show);
			},

			//动画事件
			animationEvents: function(that, moveY, show) {
				//console.log("moveY:" + moveY + "\nshow:" + show);
				that.animation = wx.createAnimation({
					transformOrigin: "50% 50%",
					duration: 400,
					timingFunction: "ease",
					delay: 0
				});
				that.animation.translateY(moveY + 'vh').step();
				that.setData({
					animation: that.animation.export()
				});
			},

			// 空方法
			nono() {

			},

			/**
			 * 获取经纬度
			 */
			chooseLocation: function(e) {
				var that = this;
				console.log('进入chooseLocation函数')
				uni.chooseLocation({
					success: function(res) {
						console.log('succes1');
						console.log(res);
						that.setMapData(res);
					},
					fail: function() {
						console.log('fail')
						wx.getSetting({
							success(res) {
								console.log('请求获取定位权限')
								if (!res.authSetting['scope.userLocation']) {
									console.log("f1");
									wx.authorize({
										scope: 'scope.userLocation',

										success() {
											uni.chooseLocation({
												success: function(res) {
													that.setMapData(res);
													console.log(res)
												}
											});
											console.log('success2');
										},

										fail() {
											wx.showToast({
												title: this.i18n.authorityTips,
												icon: 'none'
											});
										}
									});
								}
							}
						});
					}
				});
			},

			setMapData(res) {
				this.lat = res.latitude; // 纬度
				this.lng = res.longitude; // 经度
				this.addr = res.address; // 详细地址
				this.name = res.name; // 详细地址

				console.log('腾讯/高德地图经纬度：', this.lng, '，', this.lat)

				this.qqMapTransBMap(this.lng, this.lat)
			},

			// 将腾讯/高德地图经纬度转换为百度地图经纬度
			qqMapTransBMap: function(lng, lat) {
				let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
				let x = lng;
				let y = lat;
				let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
				let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
				let lngs = z * Math.cos(theta) + 0.0065;
				let lats = z * Math.sin(theta) + 0.006;

				this.lng = lngs
				this.lat = lats

				console.log('百度地图经纬度：', this.lng, '，', this.lat)
				return {
					lng: lngs,
					lat: lats
				}
			},

		},

	};
</script>
<style lang="scss">
	.submit-order-wrapper {

		/* 收货地址 */
		.submit-order {
			padding: 0 20rpx;
			padding-top: 20rpx;
			padding-bottom: 130rpx;

			.bg {
				position: absolute;
				top: 0;
				left: 0;
				width: 750rpx;
				height: 700rpx;
				font-size: 0;
				background: linear-gradient(#e43130, #f4f4f4)
			}


			/* 收货地址 */
			.distribution-mode {
				padding: 30rpx 30rpx 0;
				position: relative;

				.item-box {
					background: rgba(106, 4, 4, 0.2);
					width: 380rpx;
					height: 60rpx;
					line-height: 60rpx;
					border-radius: 60rpx;
					display: flex;
					margin: 0 auto;

					.item {
						flex: 1;
						border-radius: 60rpx;
						font-size: 28rpx;
						color: #fff;
						text-align: center;
					}


					.item.active {
						color: #E43130;
						background: #fff;
					}
				}
			}
		}

		/* 邮寄到家/到店自提 */
		.address-box {
			background: #fff;
			position: relative;
			border-radius: 10rpx;
			width: 100%;
			padding: 30rpx;
			box-sizing: border-box;
			margin-top: 30rpx;

			.tit {
				display: flex;
				justify-content: space-between;
				line-height: 40rpx;
				font-size: 28rpx;

				.text {
					font-weight: 600;
				}

				.total {
					color: #e43130;
					position: relative;
					padding-right: 28rpx;
				}

				.total::after {
					position: absolute;
					right: 10rpx;
					top: 50%;
					display: block;
					width: 14rpx;
					height: 14rpx;
					border: 2rpx solid #666;
					border-width: 2rpx 2rpx 0 0;
					content: " ";
					font-size: 0;
					transform: rotate(45deg) translateY(-50%);
				}
			}

			.add-item {
				display: flex;
				align-items: center;
				margin-top: 30rpx;
				font-size: 24rpx;
				position: relative;

				.text {
					width: 120rpx;
				}

				.input,
				.area {
					flex: 1;
					padding: 0 30rpx 0 30rpx;
					font-size: 24rpx;
					height: 80rpx;
					border-radius: 80rpx;
					background: #f5f5f5;
				}

				.input {
					padding-right: 70rpx;
				}

				.addres-icon {
					position: absolute;
					right: 24rpx;
					top: 50%;
					width: 30rpx;
					height: 30rpx;
					transform: translateY(-50%);
				}

				.btn {
					width: 220rpx;
					height: 60rpx;
					line-height: 60rpx;
					border-radius: 60rpx;
					font-size: 24rpx;
					text-align: center;
					border: 2rpx solid #e43130;
					color: #e43130;
					margin: 0 auto;
				}

				.area {
					position: relative;
					height: 80rpx;
					line-height: 80rpx;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 1;
					overflow: hidden;
					text-overflow: ellipsis;

					.placeholder-text {
						color: #808080;
					}

					picker-view {
						background-color: white;
						padding: 0;
						width: 100%;
						height: 380rpx;
						bottom: 0;
						position: fixed;

						text {
							color: #999;
							display: inline-flex;
							position: fixed;
							margin-top: 20rpx;
							height: 50rpx;
							text-align: center;
							line-height: 50rpx;
							font-size: 34rpx;
							font-family: Arial, Helvetica, sans-serif;
						}

						picker-view-column {
							view {
								vertical-align: middle;
								font-size: 30rpx;
								line-height: 30rpx;
								height: 100%;
								display: flex;
								align-items: center;
								justify-content: center;
							}
						}
					}

					.animation-element-wrapper {
						display: flex;
						position: fixed;
						left: 0;
						top: 0;
						height: 100%;
						width: 100%;
						background-color: rgba(0, 0, 0, 0.6);
						z-index: 999;


						.animation-element {
							display: flex;
							position: fixed;
							width: 100%;
							height: 530rpx;
							bottom: 0;
							background-color: rgba(255, 255, 255, 1);

							.right-bt {
								right: 20rpx;
								top: 20rpx;
								position: absolute;
								width: 80rpx !important;
							}

							.line {
								display: block;
								position: fixed;
								height: 2rpx;
								width: 100%;
								margin-top: 89rpx;
								background-color: #eee;
							}
						}
					}
				}

				.area::after {
					position: absolute;
					right: 30rpx;
					top: 48%;
					display: block;
					width: 14rpx;
					height: 14rpx;
					border: 2rpx solid #666;
					border-width: 2rpx 2rpx 0 0;
					content: " ";
					font-size: 0;
					transform: rotate(45deg) translateY(-50%);
				}
			}

			.current-address {
				margin: 20rpx 0;
				position: relative;
				padding-right: 58rpx;

				.c-address {
					font-size: 28rpx;
					font-weight: 600;
					line-height: 40rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 3;
					-webkit-box-orient: vertical;
					position: relative;
					word-wrap: break-word;
				}

				.c-user {
					font-size: 24rpx;
					margin-top: 20rpx;
				}

				.c-edit {
					font-size: 0;
					position: absolute;
					top: 6rpx;
					right: 10rpx;
					opacity: .5;

					image {
						width: 32rpx;
						height: 32rpx;
					}
				}
			}

			.choose-way {
				padding-top: 30rpx;
				margin-top: 30rpx;
				border-top: 1px solid #eee;
				font-size: 28rpx;
				display: flex;
				line-height: 40rpx;
				justify-content: space-between;

				.text {
					font-weight: 600;
				}

				.go {
					position: relative;
					padding-right: 28rpx;
				}

				.go::after {
					position: absolute;
					right: 8rpx;
					top: 45%;
					display: block;
					width: 14rpx;
					height: 14rpx;
					border: 2rpx solid #666;
					border-width: 2rpx 2rpx 0 0;
					content: " ";
					font-size: 0;
					transform: rotate(45deg) translateY(-50%);
				}
			}

			/* 到店自提 */
			.self-raising {
				padding-bottom: 30rpx;
				border-bottom: 2rpx solid #eee;

				.choose-store {
					display: flex;
					align-items: flex-start;
					padding-top: 30rpx;

					.img {
						width: 28rpx;
						height: 28rpx;
						margin: 6rpx 10rpx 0 0;
					}

					.text {
						font-size: 28rpx;
						font-weight: 600;
						/* height: 80rpx;
		line-height: 40rpx; */
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 2;
						overflow: hidden;
						text-overflow: ellipsis;
						position: relative;
						padding-right: 28rpx;
						flex: 1;
					}

					.text::after {
						position: absolute;
						right: 4px;
						top: 12rpx;
						display: block;
						width: 14rpx;
						height: 14rpx;
						border: 2rpx solid #666;
						border-width: 2rpx 2rpx 0 0;
						content: " ";
						font-size: 0;
						-webkit-transform: rotate(45deg);
						transform: rotate(45deg);
					}
				}
			}

			.raising-user {
				margin-top: 30rpx;
				padding-bottom: 6rpx;

				.user-info {
					margin-top: 30rpx;
					font-size: 24rpx;

					.input {
						padding: 0 30rpx;
						font-size: 24rpx;
						background: #f5f5f5;
						height: 80rpx;
						border-radius: 80rpx;
					}
				}
			}
		}

		/* 店铺 */
		.shop-item {
			background: #fff;
			border-radius: 10rpx;
			margin-top: 20rpx;
			position: relative;


			.shop-box {
				padding: 20rpx;
				position: relative;
				display: flex;
				align-items: center;

				&::after {
					position: absolute;
					left: 20rpx;
					right: 20rpx;
					bottom: 0;
					display: block;
					width: auto;
					height: 2rpx;
					content: " ";
					font-size: 0;
					background: #eee;
				}

				.shop-icon {
					width: 28rpx;
					height: 28rpx;
					font-size: 0;
					margin-right: 10rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.shop-name {
					flex: 1;
					font-size: 28rpx;
					font-weight: 600;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 1;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}

			.prod-item {
				.item-cont {
					display: flex;
					padding: 26rpx 20rpx;
					position: relative;

					&::after {
						position: absolute;
						left: 20rpx;
						right: 20rpx;
						bottom: 0;
						display: block;
						width: auto;
						height: 2rpx;
						content: " ";
						font-size: 0;
						background: #eee;
					}
				}

				.prod-pic {
					font-size: 0;
					width: 180rpx;
					height: 180rpx;
					border-radius: 10rpx;
					overflow: hidden;
					background: #fff;
					margin-right: 20rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.prod-info {
					font-size: 24rpx;
					position: relative;
					-webkit-flex: 1;
					-ms-flex: 1;
					-webkit-box-flex: 1;
					-moz-box-flex: 1;
					flex: 1;

					.prodname {
						font-size: 28rpx;
						line-height: 36rpx;
						overflow: hidden;
						display: -webkit-box;
						-webkit-line-clamp: 2;
						-webkit-box-orient: vertical;
						text-overflow: ellipsis;
						word-break: break-word;
					}

					.prod-info-cont {
						color: #999;
						margin-top: 10rpx;
						overflow: hidden;
						display: -webkit-box;
						-webkit-line-clamp: 1;
						-webkit-box-orient: vertical;
						text-overflow: ellipsis;
						word-break: break-all;
					}
				}

				.price-nums {
					display: flex;
					align-items: baseline;
					position: absolute;
					bottom: 0;
					width: 100%;

					.prodprice {
						flex: 1;
						margin-right: 20rpx;
						display: -webkit-box;
						-webkit-box-orient: vertical;
						-webkit-line-clamp: 1;
						overflow: hidden;
						text-overflow: ellipsis;
						color: #e43130;
					}

					.prodcount {
						font-size: 24rpx;
						color: #999;
						margin-right: 10rpx;
					}
				}
			}

			/* 促销样式 */
			.prod-item .prod-block {
				background: #fff;
			}

			.prod-item .prod-block.discount .item-cont {
				position: relative;
				margin-left: 20rpx;
			}

			.prod-item .prod-block.discount .item-cont::before {
				content: "";
				position: absolute;
				left: 0;
				top: 0;
				bottom: 0;
				width: 0;
				border-left: 2rpx dashed #ddd;
				z-index: 0;
			}

			.prod-item .prod-block.discount .item-cont:first-child::before {
				top: 26rpx;
			}

			.prod-item .prod-block.discount .pre-sell.item-cont::before {
				display: none;
			}

			.prod-item .prod-block.discount .item-cont::after {
				left: 0;
			}

			.prod-item .prod-block .discount-tips {
				padding: 20rpx 20rpx 0;
				margin-bottom: -3px;
				display: flex;
				align-items: flex-start;
				position: relative;
			}

			.prod-item .prod-block .discount-tips::before {
				content: "";
				position: absolute;
				left: 20rpx;
				top: 24rpx;
				bottom: -16rpx;
				width: 0;
				border-left: 2rpx dashed #ddd;
				z-index: 0;
			}

			.prod-item .prod-block .discount-tips .text-block {
				padding: 2rpx 10rpx;
				border-radius: 4rpx;
				font-size: 20rpx;
				background: #e43130;
				color: #fff;
				position: relative;
				line-height: 24rpx;
				margin-top: 4rpx;
			}

			.prod-item .prod-block .discount-tips .text-block::before {
				position: absolute;
				left: 0;
				bottom: -8rpx;
				content: " ";
				font-size: 0;
				display: block;
				border: 6rpx solid transparent;
				border-left: 6rpx solid #e43130;
				border-top: 6rpx solid #e43130;
			}

			.prod-item .prod-block .discount-tips .text-list {
				margin-left: 10rpx;
				line-height: 36rpx;
				flex: 1;
				font-size: 24rpx;
			}
		}

		/* 不满足当前配送方式的商品 */
		.shop-item .useless {
			/* margin: 0 20rpx; */
			padding: 20rpx;
			background: #f6f9fb;
			border-bottom: 2rpx solid #eee;
			border-radius: 10rpx;

			.u-reason {
				color: #999;
				font-size: 24rpx;
			}

			.u-con {
				margin-top: 20rpx;
			}

			.u-con::-webkit-scrollbar {
				width: 0;
				height: 0;
			}

			.u-box {
				white-space: nowrap;
				width: 100%;

				.u-prods {
					width: 80rpx;
					height: 80rpx;
					font-size: 0;
					margin-right: 20rpx;
					display: inline-block;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}
		}

		/* 优惠券和留言 */
		.shop-item .msg-item {
			padding: 0 20rpx;

			.item {
				display: flex;
				border-bottom: 2rpx solid #eee;
				font-size: 24rpx;
				padding: 24rpx 0;
				align-items: center;

				.text-box {
					flex: 1;

					.number {
						color: #999;
					}
				}

				.amount {
					color: #e43130;
					position: relative;
					padding-right: 28rpx;

					.big-num {
						font-size: 28rpx;
					}
				}

				.amount::after {
					position: absolute;
					right: 8rpx;
					top: 45%;
					display: block;
					width: 14rpx;
					height: 14rpx;
					border: 2rpx solid #666;
					border-width: 2rpx 2rpx 0 0;
					content: " ";
					font-size: 0;
					transform: rotate(45deg) translateY(-50%);
				}

				.input {
					flex: 1;
					background: #fff;
					margin-top: 2rpx;
					font-size: 24rpx;
				}

				.input-placeholder {
					color: #999;
				}
			}

			.item:last-child {
				border: 0;
			}
		}

		/* 会员积分 */
		.member-points {
			display: flex;
			justify-content: space-between;
			width: 100%;

			.tips {
				flex: 1;
				margin-right: auto;
			}
		}

		.integral-icon {
			display: inline-block;
			width: 35rpx;
			height: 35rpx;
			vertical-align: middle;
		}

		.integral-icon>image {
			display: block;
			width: 100%;
			height: 100%;
		}

		.integral-deduction {
			display: flex;
		}

		.integral-tips {
			color: #999;
			display: flex;
			align-items: center;
		}

		.integral-tips>image {
			margin-left: 10rpx;
			width: 32rpx;
			height: 32rpx;
		}

		.integral-right-select {
			display: inline-block;
			line-height: 1em;
			margin-left: 15rpx;
			position: absolute;
			right: 0;
		}

		.integral-right-select1 {
			display: inline-block;
			line-height: 1em;
		}

		.all {
			font-size: 28rpx;
			margin-left: 20rpx;
		}

		.all label {
			display: flex;
			align-items: center;
		}

		/* 底部栏 */
		.submit-order-footer {
			position: fixed;
			bottom: 0;
			width: 100%;
			max-width: 750rpx;
			background: #fff;
			margin: auto;
			display: flex;
			align-items: center;
			box-shadow: 0 -2rpx 6rpx rgba(0, 0, 0, 0.05);
			z-index: 10;
		}

		.submit-order-footer .sub-order {
			flex: 1;
			margin: 0 30rpx;
			line-height: 100rpx;
			display: block;
			text-align: left;
			font-size: 24rpx;
			background: #fff;
			z-index: 5;
		}

		.item-txt {
			height: 110rpx;
			line-height: 110rpx;
		}

		.submit-order-footer .sub-order .item-txt .price {
			color: #e43130;
			font-weight: 600;
		}

		.submit-order-footer .sub-order .item-txt .price .symbol,
		.submit-order-footer .sub-order .item-txt .price .small-num {
			font-size: 28rpx;
		}

		.submit-order-footer .sub-order .item-txt .price .big-num {
			font-size: 36rpx;
		}

		.submit-order-footer .footer-box {
			width: 220rpx;
			background: #e43130;
			text-align: center;
			color: #fff;
			font-size: 28rpx;
			border-radius: 70rpx;
			height: 70rpx;
			line-height: 70rpx;
			margin-right: 20rpx;
		}

		/** 优惠券弹窗 **/
		.popup-hide {
			position: fixed;
			top: 0;
			bottom: 0;
			left: 0;
			right: 0;
			z-index: 999;
			background-color: rgba(0, 0, 0, 0.3);
		}

		.popup-box {
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 80%;
			overflow: hidden;
			background-color: #fff;
			border-radius: 10rpx 10rpx 0 0;
		}

		.popup-tit {
			padding: 20rpx;
			font-size: 28rpx;
			font-weight: bold;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.close {
			color: #666;
			font-size: 32rpx;
		}

		.close::before {
			content: "\2715";
		}

		.coupon-tabs {
			display: flex;
			font-size: 14px;
			justify-content: space-around;
			box-shadow: 0 4rpx 6rpx rgba(0, 0, 0, 0.07);
			position: relative;
			z-index: 1;
		}

		.coupon-tab {
			padding: 10px 0;
			font-family: arial;
		}

		.coupon-tab.on {
			border-bottom: 2px solid #e43130;
			font-weight: 600;
			color: #e43130;
		}

		.popup-cnt {
			height: calc(100% - 280rpx);
			overflow: auto;
			padding: 0 30rpx;
		}

		.popup-cnt.on {
			height: calc(100% - 200rpx);
			overflow: auto;
			padding: 0 30rpx;
		}

		.popup-cnt.sts2 {
			height: calc(100% - 160rpx);
		}

		.popup-cnt::-webkit-scrollbar {
			width: 0;
			height: 0;
		}

		.coupon-con {
			/* padding-bottom: 80rpx; */
		}

		.coupon-ok {
			position: fixed;
			bottom: 0;
			width: 100%;
			padding: 20rpx 30rpx;
			box-sizing: border-box;
			text-align: center;
			box-shadow: 0 -2rpx 6rpx rgba(0, 0, 0, 0.05);
			background: #fff;
		}

		.coupon-ok .btn {
			background: #e43130;
			text-align: center;
			color: #fff;
			font-size: 28rpx;
			border-radius: 80rpx;
			height: 80rpx;
			line-height: 80rpx;
		}

		.botm-empty {
			height: 150rpx;
			line-height: 150rpx;
			font-size: 24rpx;
			color: #999;
			text-align: center;
		}

		/* 修改积分弹出层 */
		.score-pop {
			position: absolute;
			top: 50%;
			left: 10%;
			transform: translateY(-50%);
			width: 80%;
			border-radius: 10rpx;
			padding: 30rpx;
			box-sizing: border-box;
			background: #fff;
		}

		.score-pop .popup-tit {
			padding: 0;
		}

		.score-pop .score-pop-con {
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			align-items: center;
			height: 90%;
		}

		.score-pop-item {
			width: 100%;
		}

		.usable-tips {
			display: inline-block;
			font-size: 24rpx;
			color: #999999;
			margin-top: 18rpx;
		}

		.score-pop .score-pop-con .score-int {
			padding: 30rpx 0 10rpx;
			font-size: 28rpx;
			font-family: arial;
			border-bottom: 2rpx solid #ddd;
			/* 解决ios输入框无法输入 */
			-webkit-user-select: text !important;
		}

		.score-pop .score-pop-con .confirm-btn {
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 80rpx;
			background: #e43130;
			color: #fff;
			text-align: center;
			margin-top: 40rpx;
			font-size: 28rpx;
		}

		/* 选择配送方式弹窗 */
		.popup-hide .popup-box.height-auto {
			height: auto;
		}

		.popup-hide .con-tit {
			display: flex;
			justify-content: space-around;
			align-items: center;
			font-size: 28rpx;
			font-weight: bold;
			padding: 30rpx;
		}

		.popup-hide .con-tit .sure {
			font-size: 0;
			width: 32rpx;
			height: 32rpx;
		}

		.popup-hide .con-tit .sure image {
			width: 100%;
			height: 100%;
		}

		.popup-hide .con-tit .tit-text {
			flex: 1;
			text-align: center;
		}

		.popup-hide .pop-con {
			padding: 0 30rpx;
		}

		.popup-hide .pop-con .distribution-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx 0;
			border-top: 2rpx solid #eee;
			font-size: 28rpx;
		}

		/* 可用地址弹窗 */

		.popup-hide .address-list {
			height: 60%;
		}

		.popup-hide .address-list .con-tit {
			position: relative;
		}

		.popup-hide .address-list .con-tit::after {
			position: absolute;
			left: 30rpx;
			right: 30rpx;
			bottom: 0;
			display: block;
			width: auto;
			height: 2rpx;
			content: " ";
			font-size: 0;
			background: #eee;
		}

		.popup-hide .address-box {
			padding: 0 30rpx;
			height: calc(100% - 104rpx);
			overflow-y: auto;
		}

		.popup-hide .address-box::-webkit-scrollbar {
			width: 0;
			height: 0;
		}

		.popup-hide .address-box .item {
			display: flex;
			align-items: center;
			padding: 30rpx 0;
			border-bottom: 2rpx solid #eee;
		}

		.popup-hide .address-box .item:last-child {
			border: 0;
		}

		.popup-hide .address-box .item .text-box {
			flex: 1;
			margin-right: 20rpx;
			font-size: 26rpx;
		}

		.popup-hide .address-box .item .text-box .address {
			line-height: 36rpx;
			word-break: break-word;
		}

		.popup-hide .address-box .item .text-box .address .default-address {
			padding: 2rpx 6rpx;
			border-radius: 2px;
			font-size: 10px;
			background: #e43130;
			color: #fff;
			display: inline-block;
			line-height: 24rpx;
			vertical-align: top;
			margin-right: 10rpx;
			margin-top: 4rpx;
		}

		.popup-hide .address-box .item .text-box .user {
			word-break: break-all;
			margin-top: 10rpx;
			color: #999;
		}

		/* 历史提货人弹窗 */
		.popup-hide .history-user {
			height: auto;
			min-height: 45%;
		}

		.popup-hide .history-user .item .text-box .history-picker-user {
			display: flex;
		}

		.popup-hide .history-user .item .text-box .address .gray {
			color: #999;
			word-break: keep-all;
		}

		/* 选择提货时间弹窗 */
		.popup-hide .raising-time {
			height: 60%;
		}

		.popup-hide .raising-time .time-box {
			height: calc(100% - 104rpx);
			display: flex;
			font-size: 24rpx;
			font-family: arial;
			border-top: 2rpx solid #eee;
		}

		.popup-hide .raising-time .time-box .day-box {
			background: #f5f5f5;
			width: 220rpx;
		}

		.popup-hide .raising-time .time-box .day-box .item {
			padding: 30rpx 0;
			height: 40rpx;
			line-height: 40rpx;
			text-align: center;
		}

		.popup-hide .raising-time .time-box .day-box .item.active {
			background: #fff;
		}

		.popup-hide .raising-time .time-box .hour-box {
			flex: 1;
			padding: 10rpx 30rpx;
			overflow-y: auto;
		}

		.popup-hide .raising-time .time-box .hour-box .item {
			display: flex;
			align-items: center;
			height: 40rpx;
			padding: 24rpx 0;
		}

		.popup-hide .raising-time .time-box .hour-box .item .number {
			flex: 1;
			line-height: 40rpx;
			font-size: 14px;
		}

		.red-word {
			color: #e43130;
		}


		/* 错误提示 */
		.error .error-text {
			display: block;
			width: 100%;
			font-size: 28rpx;
			color: #e43130;
			text-align: left;
			margin-top: 10rpx;
		}

		.error .error-text .warning-icon {
			display: inline-block;
			color: #fff;
			width: 26rpx;
			height: 26rpx;
			line-height: 26rpx;
			background: #e43130;
			border-radius: 50%;
			text-align: center;
			margin-right: 12rpx;
			font-size: 22rpx;
		}

		.map {
			height: 100%;
		}

		.goOut {
			background-color: #fff;
			text-align: center;
		}
	}
</style>
